﻿<Window xmlns:my="clr-namespace:BaiduImage"  x:Class="BaiduImage.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid Name="_layout">
        <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBox Name="_ctlWord" Width="200"/><Button Content="查询" Click="Button_Click" />
        </StackPanel>
        <Grid Grid.Row="1">
            <ListBox Name="_ctlContainer" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Border BorderThickness="1" BorderBrush="Black" Margin="5,5,0,0">
                            <Image Source="{Binding Source}" Width="50" Height="50"  MouseLeftButtonUp="Image_MouseLeftButtonUp"/>
                        </Border>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
        </Grid>
    </Grid>
</Window>
